//
//  ContentView.swift
//  MyButton
//
//  Created by SmartStrategy on 2020/3/23.
//  Copyright © 2020 SmartStrategy. All rights reserved.
//

import SwiftUI

struct GCPresentedView:View {
    let message:String
    var body: some View {
        VStack{
            Text(message)
                .font(.largeTitle)
        }
    }
}

struct ContentView: View {
    @State var ispresented = false
    var body: some View {
        VStack{
            Button("MyButton"){
                self.ispresented = true
            }.sheet(isPresented: $ispresented) { 
                GCPresentedView(message: "22222")
            }
            Button.init(action: {
                print("myButton1")
            }) {
                Text("MyButtom3")
            }
            
            Button.init(action: {
                print("myButton4")
            }) {
                Text("myButton4")
                Image.init(systemName: "clock")
            }
            .foregroundColor(Color.white)
            .background(Color.green)
            
            Button.init(action: {
                print("myButton5")
            }) {
                Text("MyButton5")
            }
            .padding(30)
            .background(Color.yellow)
            
            Button.init(action: {
                print("MyButton6")
            }) {
                Text("myButton6")
                .padding(30)
                    .background(Color.green)
                
            }
            
            Button.init(action: {
                print("MyButton7")
            }) {
                HStack{
                    Image.init(systemName: "star")
                    Text("Mybutton7")
                }
            .padding()
                .background(Color.yellow)
            }
            
            
            
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
